package oem.spc;

import java.util.ArrayList;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class MyAdapter extends BaseAdapter {

	private Context ctx;

	private ArrayList<String> coll;

	public MyAdapter(Context context) {

		ctx = context;

		setColl(coll);

	}
	public void setColl(ArrayList<String> c) {

		coll = c;

	}

	public int getCount() {

		return coll.size();

	}

	public Object getItem(int position) {

		return coll.get(position);

	}

	public long getItemId(int position) {

		return position;

	}

	public View getView(int position, View convertView, ViewGroup parent) {

		TextView tv;
		
		if (convertView == null) {

			tv = new TextView(ctx);
			//tv = mInflater.inflate(R.layout.grid_item, null);
		} else {

			tv = (TextView) convertView;
		}
		
		tv.setTextColor(Color.CYAN);

		tv.setHeight(45);

		tv.setTextSize(26);

		tv.setText(coll.get(position));

		return tv;

	}
}
